package com.fixme4trade.domain;

import java.io.Serializable;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Column;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.validation.constraints.NotNull;

@Entity
public class ProductRule implements Serializable {
		
	private static final long serialVersionUID = 1L;

	@Id
	//@GeneratedValue
	@SequenceGenerator( name = "PRODUCT_RULE_ID", sequenceName = "PRODUCT_RULE_SEQ", allocationSize = 1 )  
	@GeneratedValue( strategy = GenerationType.SEQUENCE, generator = "PRODUCT_RULE_ID" )
	@Column(name="product_rule_id")
	private Long id;
	
	@NotNull
	private String name;
	
	@ManyToOne
	@JoinColumn(name="seller_id", referencedColumnName="seller_id", nullable=false)
	private Seller owner;

	public ProductRule() {

	}

	public Long getId() {
		return id;
	}

	public void setId(final Long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(final String name) {
		this.name = name;
	}

	public Seller getOwner() {
		return owner;
	}

	public void setOwner(final Seller owner) {
		this.owner = owner;
	}
}
